<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ include file="common.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<script type="text/javascript">
	$(document).ready(function() {
		$("#itemName").focus();
		$("#itemDetails").attr("action",'<c:url value="/updateItem.htm"></c:url>');
		});
	</script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Add Item</title>
</head>
<body>
<form:form commandName="itemDetails" id="itemDetails">
<form:hidden path="version"/>
<form:hidden path="strCreatedAuthor"/>
<form:hidden path="createdDate"/>
<form:hidden path="itemId"/>
<input type="hidden" value="${itemDetails.itemName}" name="oldItemName"></input>
	<table class="mainTable">
		<tr>
			<td>
				<form:label path="itemName">Item Name</form:label>
			</td>
			<td>
				<form:input path="itemName" id="itemName"/>
			</td>
		</tr>	
		<tr>
			<td>
				<form:label path="itemStock">Available Stock</form:label>
			</td>
			<td>
				<form:input path="itemStock" readonly="true"/>
			</td>
		</tr>		
		<tr>
			<td>
				<form:label path="minItemStock">Minimum Quantity of Item</form:label>
			</td>
			<td>
				<form:input path="minItemStock"/>
				<form:errors path="minItemStock"></form:errors>
			</td>
		</tr>				
		<tr>
			<td>
				<form:label path="itemUnitType">Unit Type</form:label>
			</td>
			<td>
				<form:select path="itemUnitType">
					<form:option value="0">Select Unit Type</form:option>
					<form:option value="Piece">Piece</form:option>
					<form:option value="Box">Box</form:option>
				</form:select>
			</td>
		</tr>	
		<tr>
			<td>
				<input type="button" value="Update Item" id="addNewItemButton" onclick="saveEntity('itemDetails')">
			</td>
		</tr>
	</table>
</form:form>
</body>
</html>